package terra.util;

import java.io.Serializable;

public class Point implements Serializable{

	private static final long serialVersionUID = -6361051917554910225L;
	private int x;
	private int y;
	int hashCode;
	
	public Point(int x, int y){
		setX(x);
		setY(y);
	}
	
	public Point(Point other){
		setX(other.getX());
		setY(other.getY());
	}
	
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	
	public boolean equals(Object other){
		if (other instanceof Point){
			if (((Point) other).getX() == getX() && 
					((Point) other).getY() == getY()) {
				return true;
			}
			return false;
		}
		return super.equals(other);
	}
	
	public int hashCode() {
		return x*y;
	}
}
